package 代理模式.demo1;

public class Main {
	public static void main(String[] args) {
		//test1();
		test2();
	}

	public static void test1() {
		String name = "caiya";
		IBuyer buyer = new Buyer(name);
		buyer.login(name, "123456");
		buyer.buyTicket();
	}

	public static void test2() {
		String name = "caiya";
		IBuyer buyer = new Buyer(name);
		IBuyer proxyBuyer = new BuyerProxy(buyer);
		proxyBuyer.login(name, "123456");
		proxyBuyer.buyTicket();
	}
}
